﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace POVRay {
    public class CacheFile : Block {
        public string FileName { get; set; }
        public FileOperation Operation { get; set; }

        public CacheFile(string fileName, FileOperation operation) {
            FileName = fileName;
            Operation = operation;
        }

        public static CacheFile SaveCacheFile(string filename) {
            return new CacheFile(filename, FileOperation.Save);
        }

        public static CacheFile LoadCacheFile(string filename) {
            return new CacheFile(filename, FileOperation.Load);
        }

        public override string ToString(int level) {
            string keyword = Operation == FileOperation.Save ? "save_file" : "load_file";
            return keyword + " \"" + FileName + "\"";
        }
    }

    public enum FileOperation {
        Save,
        Load
    }
}
